// 激光束测试

string author = "Live";
string pluginName = "Beam 激光束插件";
string version = "0.1";

// 当插件被初始化
void OnPluginInit()
{
	// 设置插件信息
	PluginData::SetAuthor(author);
	PluginData::SetName(pluginName);
	PluginData::SetVersion(version);

	// 提示
	ThePresident.InfoFeed("插件:"+pluginName+"| 版本:"+version+"| 作者:"+author,false);

    Events::Player::PlayerSay.Hook( @PlayerSay );
}

HookReturnCode PlayerSay(CTerrorPlayer@ pPlayer, CASCommand@ pArgs)
{
    string arg = pArgs.Arg(1);
    if( arg == "!t" ){
        CBaseEntity@ BaseWeapon = pPlayer.GetCurrentWeapon();
        Utils.CreateBeam(BaseWeapon,"","",Vector(100,100,pPlayer.GetAbsOrigin().z), Color( 255, 75, 75, 255 ), 1.0f, 10.0f, 100.0f);
    }
    if( arg == "!a" ){
        // UserMessage.Begin(null,"HintText");
        // UserMessage.WriteString( pPlayer.GetPlayerName() + " has spawned!" );
        // UserMessage.End();
        Chat.PrintToChat(all,""+NetProp::GetPropInt(pPlayer.GetCurrentWeapon(), "m_iExtraPrimaryAmmo"));
        // NetProp::SetPropFloat(pPlayer.GetCurrentWeapon(), "m_flSimulationTime", 1.0f);
        // NetProp::SetPropInt(pPlayer.GetCurrentWeapon(), "m_flSimulationTime", 1);
    }
    return HOOK_CONTINUE;
}